package tools;

import com.alibaba.fastjson.JSONArray;

import java.io.File;

/**
 * Created by yangxianming on 2021/3/24.
 * 列出所有业务方法的类名；以便配置权限
 */
public class GetMyClass {
    public static void main(String[] args) {
        File file = new File("D:\\javaWorkSpace\\testServer2\\src");
        JSONArray jo = new JSONArray();
        JSONArray business = new JSONArray();
        for (File one: file.listFiles()){
            if (one.isDirectory() && one.getName().contains("Business")){
                String dir = one.getName();
                File fileInner = new File("D:\\javaWorkSpace\\testServer2\\src\\"+one.getName());
                JSONArray ja = new JSONArray();
                ja.add(dir);
                business.add(dir.substring(0, dir.indexOf("Business")));
                for (File oneInner: fileInner.listFiles()){
                    if (!oneInner.isDirectory()){
                        String s = oneInner.getName();
                        ja.add(s.substring(0, s.indexOf(".")));
                    }
                }
                System.out.println(ja + ",");
                jo.add(ja);
            }
        }
        System.out.println("\n\n"+business);
        System.out.println("\n\n"+jo);
    }
}
